package org.zfes.snowier.cloud.zbss.pmp.service.impl;

import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.zfes.snowier.core.data.DataSet;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.zfes.snowier.core.util.ZBeanUtil;
import org.zfes.snowier.core.util.ZObjectUtil;

import com.google.common.collect.Lists;

import org.zfes.snowier.core.util.ZAlert;
import org.zfes.snowier.core.util.ZAssert;
import org.zfes.snowier.common.dao.params.ParamMap;
import org.zfes.snowier.cloud.zbss.pmp.service.IPmpBugsRecordService;
import org.zfes.snowier.cloud.zbss.pmp.dao.PmpBugsRecordMapper;
import org.zfes.snowier.cloud.zbss.pmp.model.PmpBugsRecord;
import java.util.stream.Stream;
@Service
public class PmpBugsRecordServiceImpl implements IPmpBugsRecordService{
 	@Autowired
	private PmpBugsRecordMapper pmpBugsRecordMapper;
	
	@Transactional(rollbackFor=Exception.class)
 	@Override
	public void createPmpBugsRecord(PmpBugsRecord pmpBugsRecord) {
		ZBeanUtil.setCreateInfo(pmpBugsRecord);
		ZBeanUtil.validateBean(pmpBugsRecord);
		pmpBugsRecordMapper.insertSelective(pmpBugsRecord);
	}
	
	
	@Transactional(rollbackFor=Exception.class,readOnly=true)
	@Override
	public List<PmpBugsRecord> loadRecordByBugId(Long bugId){
		if(ZObjectUtil.isNull(bugId)) {
			return Lists.newArrayList();
		}
		return pmpBugsRecordMapper.selectByBugId( bugId);
	}
	
	
	
	
	
}